package com.meizu.asum.richtextsdk.uiframework.xuidesign.utils;

import android.content.Context;
import android.content.Intent;

import com.meizu.asum.richtextsdk.tools.ScreenSizeTools;
import com.meizu.asum.richtextsdk.uiframework.xlayoutparam.utils.StateHeight;
import com.meizu.asum.richtextsdk.uiframework.xuidesign.interfaces.IUIDesigner;
import com.meizu.asum.richtextsdk.uiframework.xuidesign.utils.view.ImmersionTools;
import com.meizu.asum.richtextsdk.uiframework.xuidesign.utils.view.TextViewTools;

/**
 * Activity设计者基类
 *
 * @Author XJW
 * @CreateTime 2017/9/8
 */
public abstract class BaseActivityDesigner implements IUIDesigner {
    public Context context;
    public XDesigner designer;
    public int screenW, screenH;
    public int stateHeight;
    public int padding;
    public int space;
    public TextViewTools tTools;


    public final void design(XDesigner designer, Intent intent) {
        this.designer = designer;
        context = designer.getContext();
        screenW = ScreenSizeTools.getW(context);
        screenH = ScreenSizeTools.getH(context);
        stateHeight = StateHeight.getStatusHeight(context);
        if (!ImmersionTools.canImmersion()) {
            stateHeight = 0;
        }
        tTools = new TextViewTools();

        design(intent);
        getWidgets();
        setWidgets();
    }

    public final void design(XDesigner designer, Object... values) {
    }

    public void design(Intent intent) {
    }

    protected abstract void getWidgets();

    protected abstract void setWidgets();
}
